package com.mingqijia.gassafety.shared.constant;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: gassafety
 * @description:
 * @author: Mr.Wang
 * @create: 2023-02-08 15:50
 **/
@Getter
@RequiredArgsConstructor
public enum OperationTypeEnum {
    OPERATION_TYPE_1(1,"客户管理","新增客户","新增客户成功"),
    OPERATION_TYPE_2(2,"客户管理","导入客户","导入客户成功"),
    OPERATION_TYPE_3(3,"客户管理","安装诉求","报警器安装诉求发起成功"), //未测
    OPERATION_TYPE_4(4,"客户管理","批量安装导入","客户批量安装导入成功"), //未测
    OPERATION_TYPE_5(5,"客户管理","删除客户","删除客户成功"),

    OPERATION_TYPE_6(6,"客户管理","编辑客户信息","修改户号"),
    OPERATION_TYPE_7(7,"客户管理","编辑客户信息","修改客户名称"),
    OPERATION_TYPE_8(8,"客户管理","编辑客户信息","修改经纬度"),
    OPERATION_TYPE_9(9,"客户管理","编辑客户信息","修改所属行业"),
    OPERATION_TYPE_10(10,"客户管理","编辑客户信息","修改备注"),

    OPERATION_TYPE_11(11,"账号登录","账号登录","账号成功登录"),
    OPERATION_TYPE_12(12,"账号登录","账号登出","账号成功登出"),

    OPERATION_TYPE_13(13,"客户管理","删除联系人信息","删除联系人信息成功"), // 待验证
    OPERATION_TYPE_14(14,"客户管理","新增联系人信息","新增联系人信息成功"),// 待验证

    OPERATION_TYPE_15(15,"客户管理","修改联系人信息","修改姓名"), // 待验证
    OPERATION_TYPE_16(16,"客户管理","修改联系人信息","修改手机号"),// 待验证
    OPERATION_TYPE_17(17,"客户管理","修改联系人信息","人员级别由【%s】变更成【%s】"),// 待验证
    OPERATION_TYPE_18(18,"客户管理","修改联系人信息","修改备注"),// 待验证

    OPERATION_TYPE_19(19,"客户管理","关联设备","关联设备成功"),
    OPERATION_TYPE_20(20,"客户管理","解除关联设备","解除关联设备成功"),
    OPERATION_TYPE_21(21,"客户管理","安装位置","修改安装位置"),
    OPERATION_TYPE_22(22,"客户管理","设备名称","修改设备名称"),
    OPERATION_TYPE_23(23,"客户管理","安装地址","修改安装地址"),

    OPERATION_TYPE_24(24,"设备管理","新增设备","新增设备成功"),
    OPERATION_TYPE_25(25,"设备管理","导入设备","导入设备成功"),

    OPERATION_TYPE_26(26,"设备管理","编辑设备信息","修改ICCID"),
    OPERATION_TYPE_27(27,"设备管理","编辑设备信息","修改设备厂商"),
    OPERATION_TYPE_28(28,"设备管理","编辑设备信息","修改设备类型"),
    OPERATION_TYPE_29(29,"设备管理","编辑设备信息","修改回路信息"),
    OPERATION_TYPE_30(30,"设备管理","编辑设备信息","修改设备型号"),
    OPERATION_TYPE_31(31,"设备管理","编辑设备信息","修改设备有效期"),
    OPERATION_TYPE_32(32,"设备管理","编辑设备信息","修改说明"),

    OPERATION_TYPE_33(33,"设备管理","删除设备","删除设备成功"),

    OPERATION_TYPE_34(34,"驾驶舱","报警声音","手动关闭"),
    OPERATION_TYPE_35(35,"驾驶舱","报警声音","系统自动关闭"),

    OPERATION_TYPE_36(36,"平台","报警声音","手动关闭"),
    OPERATION_TYPE_37(37,"平台","报警声音","系统自动关闭"),
    OPERATION_TYPE_38(38,"客户管理","编辑服务信息","修改服务信息"),
    OPERATION_TYPE_39(39,"客户管理","编辑服务信息","修改服务开始日期"),
    OPERATION_TYPE_40(40,"客户管理","编辑服务信息","修改服务结束日期"),
    OPERATION_TYPE_41(41,"客户管理","编辑服务信息","修改备注"),
    OPERATION_TYPE_42(42,"客户管理","编辑服务套餐信息","修改服务套餐"),
    OPERATION_TYPE_43(43,"设备管理","批量导入删除","导入删除设备成功"),

    OPERATION_TYPE_44(44,"客户管理","更新-燃气户信息","修改户名"),
    OPERATION_TYPE_45(45,"客户管理","更新-燃气户信息","修改户址"),
    OPERATION_TYPE_46(46,"客户管理","更新-燃气户信息","修改户主手机"),
    OPERATION_TYPE_47(47,"客户管理","更新-燃气户信息","修改用户类型"),
    OPERATION_TYPE_48(48,"客户管理","更新-燃气户信息","修改气户状态")
    ;

    private final Integer code;
    private final String menu;
    private final String operationType;
    private final String detail;


    public static List<String> getInfo (Integer code){
        if (code == null){
            return null;
        }
        for (OperationTypeEnum typeEnum : OperationTypeEnum.values()) {
            if (typeEnum.code.equals(code)) {
                ArrayList<String> list = new ArrayList<>();
                list.add(typeEnum.menu);
                list.add(typeEnum.operationType);
                list.add(typeEnum.detail);
                return list;
            }
        }

        return null;
    }

}
